package pack1;

public class Test {
    public static void func(Animal animal){

    }
    public static  Animal func2(){
        Dog dog=new Dog("大黑",11);
        return dog;
    }

    public static void main(String[] args) {
        Animal animal=new Dog("大黄",5);//父类引用了子类的对象进项了向上转型
        Dog dog=new Dog("小黑",3);
        func(dog);//方法的传参进行向上转型
        Animal animal1=func2();//返回值进行向上转型
    }
}
